package com.ego.dubbo.service;

import com.ego.commons.exception.DaoException;
import com.ego.pojo.TbContent;

import java.util.List;

/**
 * @author GHP
 */
public interface TbContentDubboService {

    /**
     * 不同分类下的模糊查询
     * @param categoryId
     * @param pageNumber
     * @param pageSize
     * @return
     */
    List<TbContent> selectByPage(Long categoryId,int pageNumber,int pageSize);

    /**
     * 根据类目查询该类目的数量
     * @param categoryId
     * @return
     */
    long selectCountByCategoryId(Long categoryId);

    /**
     *新增内容
     * @param tbContent
     * @return
     * @throws DaoException
     */
    int insert(TbContent tbContent) throws DaoException;

    /**
     * 更新
     * @param tbContent
     * @return
     * @throws DaoException
     */
    int update(TbContent tbContent) throws DaoException;

    /**
     * 删除
     * @param ids
     * @return
     * @throws DaoException
     */
    int deleteByIds(long[] ids) throws DaoException;

    /**
     * 查询全部，按照更新时间降序查询
     * @param categoryId
     * @return
     */
    List<TbContent> selectAllByCategoryId(Long categoryId);
}
